/**
 * 
 */
package com.nc.delivery_project.shared.locator;

import com.google.web.bindery.requestfactory.shared.Locator;
import com.nc.delivery_project.server.domain.StateProvince;
import com.nc.delivery_project.server.service.StateProvinceService;
import com.nc.delivery_project.shared.servicelocator.StateProvinceServiceLocator;

/**
 * @author NataG
 *
 */
public class StateProvinceLocator extends Locator<StateProvince, Integer>{

	@Override
	public StateProvince create(Class<? extends StateProvince> arg0) {
		return new StateProvince();
	}

	@Override
	public StateProvince find(Class<? extends StateProvince> arg0, Integer id) {
        return ((StateProvinceService) new StateProvinceServiceLocator().getInstance(null)).read(id);
	}

	@Override
	public Class<StateProvince> getDomainType() {
		return StateProvince.class;
	}

	@Override
	public Integer getId(StateProvince arg0) {
		return arg0.getStateId();
	}

	@Override
	public Class<Integer> getIdType() {
		return Integer.class;
	}

	@Override
	public Object getVersion(StateProvince arg0) {
		return arg0.getStateId();
	}

}
